#include <iostream>
using namespace std;
#include <vector>
#include <string>

class StringFormat {
public:
//  开来还是不能使用string::replace的方法

    string formatString(string A, int n, vector<char> arg, int m) {
        // write code here
        string ret;
        int i = 0;
        auto it = A.begin();
        while (it != A.end()){
            if (*it == '%'){
                ret += arg[i++];
                it++;
            } 
            else ret += *it;
            it++;
        }
        for (; i < arg.size(); i++) ret += arg[i];
        return ret;
    }
};